Display all headersTo: picbootloader@yahoogroups.com
From: "reactivate_now"
Date: Sun, 06 Jun 2004 10:12:01 -0000
Subject: [picbootloader] Workaround for trouble with PIC16F87XA devices!
Reply-To: picbootloader@yahoogroups.com

Hello,
 
First of all, this bootloader rocks! Saved me hours of debugging!
 
I think there is indeed a bug in Shane's bootloader when using it 
with PIC16F87XA devices and there is a 3 in 4 chance that you will 
encounter it :-). When you have a hex file with a non multiple of 4 
opcodes, the bootloader won't work!
 
non-working example:
:040000008A01252824
:080008008A110A1242284A285D
:1000100056289828DF280B29142927293A2942290C
:10002000532964297529962999299C29A429AC2941
:10003000BD29C52983120313A20000308A00253090
:10004000220703188A0A2208820704308316031342
:1000503086008030870083129F010630D3
 
working example:
:040000008A01252824
:080008008A110A1242284A285D
:1000100056289828DF280B29142927293A2942290C
:10002000532964297529962999299C29A429AC2941
:10003000BD29C52983120313A20000308A00253090
:10004000220703188A0A2208820704308316031342
:100050008500F03086008030870083129F010630D3
 
 
The datasheet specs that:
1) you MUST write the FLASH in groups of 4 words. 
2) When not writing 4 WORDS you MUST READ the non-written words so 
you don't overwrite them
I assume that the bootloader sins against one of these rules, 
hopefully the authors have an idea were it can be.
 
Workaround: very simple, make sure you always have a multiple of 4 
opcodes in the hex file and it works! Simply add some nops somewhere 
to fill it up. With an editor you can easily see how many opcodes you 
have to add to have a nice alignment in the hex file at the end.
 
Hope this works for you!
greets,
 
G

[if anyone can fix this bug and post it to me, it would be great! - shane@microchipc.com]